package com.lei.huawei.Demo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;

/**
 * @author: leiGer
 * @Date: 2022/02/26
 * @Time: 14:01
 */
public class ZhaoMingProblem {
    static class T {
        int start;
        int end;
        T(int start, int end) {
            this.start = start;
            this.end = end;
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()){
            int n = scanner.nextInt();
            int []arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = scanner.nextInt();
            }
            List<T> list = new ArrayList<>();
            list.add(new T(0,arr[0]));
            for (int i = 1; i < arr.length; i++) {
                int starti = Math.max(0,i*100 - arr[i]);
                int endi = i * 100 + arr[i];
                int j = list.size()-1;
                while(j > 0){
                    if(starti <= list.get(j).start){
                        list.remove(j);
                        j--;
                    }else {
                        break;
                    }
                }
                T t = list.get(j);
                if(t.start <= starti && starti <= t.end){
                    t.end = Math.max(t.end,endi);
                }else {
                    list.add(new T(starti,endi));
                }


            }
            int count = 0;
            for (int i = 0; i < list.size()-1; i++) {
                count += list.get(i+1).start - list.get(i).end;

            }
            System.out.println(count);
        }
    }
}
